import request from '@/utils/request'
import axios from 'axios'

axios.defaults.baseURL = 'http://localhost:8000'; // 后端接口地址

export function getTodayTip() {
    return request({
        url: '/tip/today',
        method: 'get'
    })
}

export function getTip(searchText) {
    // 发送请求获取标签列表

    return axios.get('/tip/list?keyword=' + searchText)
    // }))
}

export function addTip(promotion) {
    return request({
        url: '/tip/add',
        method: 'post',
        data: promotion
    })
}


export function deleteTip(id) {

    return axios.delete('/tip/delete/' + id)
    // }))
}

export function updateTip(data) {
    return request({
        url: '/tip/update',
        method: 'post',
        data: data
    })
}